#!/bin/bash
#chkconfig:2345 30 80
#description:kafka
#processname:kafka

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64
export PATH=$JAVA_HOME/bin:$PATH



case $1 in
            start)
                /home/root/app/kafka_2.11-2.1.1/bin/kafka-server-start.sh -daemon /home/root/app/kafka_2.11-2.1.1/config/server.properties
                ;;
            stop)
                /home/root/app/kafka_2.11-2.1.1/bin/kafka-server-stop.sh
                ;;
            status)
                jps
                ;;
            restart)
                /home/root/app/kafka_2.11-2.1.1/bin/kafka-server-stop.sh
                /home/root/app/kafka_2.11-2.1.1/bin/kafka-server-start.sh -daemon /home/root/app/kafka_2.11-2.1.1/config/server.properties
                ;;
            *)
                echo "require start|stop|status|restart"
                ;;
esac